home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / Monkey Lander.swf / scripts / frame_110 / PlaceObject2_429_571 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2006-06-13  |  3.6 KB  |  111 lines

  1. onClipEvent(enterFrame){
  2.    if(pauseTimeout < getTimer())
  3.    {
  4.       if(_root.paused != true && Key.isDown(80))
  5.       {
  6.          sndWhip.start(0,0);
  7.          _parent.cocoFuel.stop();
  8.          _root.sndThrusters.stop();
  9.          _parent.mcPaused.gotoAndPlay("paused");
  10.          this.fumeDown.gotoAndStop("off");
  11.          this.fumeLeft.gotoAndStop("off");
  12.          this.fumeRight.gotoAndStop("off");
  13.          _root.paused = true;
  14.          pauseTimeout = getTimer() + 500;
  15.       }
  16.       else if(_root.paused && (Key.isDown(80) or Key.isDown(Key.UP) or Key.isDown(Key.RIGHT) or Key.isDown(Key.LEFT)))
  17.       {
  18.          sndWhip.start(0,0);
  19.          _parent.mcPaused.gotoAndPlay("out");
  20.          _root.paused = false;
  21.          pauseTimeout = getTimer() + 500;
  22.       }
  23.    }
  24.    if(_root.paused != true)
  25.    {
  26.       if(_root.landed != true)
  27.       {
  28.          if(_root.outOfFuel != true)
  29.          {
  30.             if(Key.isDown(Key.UP))
  31.             {
  32.                gravity -= gravityFactor * thrusterPower;
  33.                if(this.fumeDown.fumeOn != true)
  34.                {
  35.                   this.fumeDown.gotoAndPlay("on");
  36.                   _parent.monkeyShip.rightArm.gotoAndPlay("push");
  37.                }
  38.             }
  39.             else
  40.             {
  41.                this.fumeDown.gotoAndPlay("off");
  42.                _parent.monkeyShip.rightArm.gotoAndPlay("idle");
  43.             }
  44.             if(Key.isDown(Key.RIGHT))
  45.             {
  46.                xMovement += thrusterPower / 15;
  47.                if(this.fumeLeft.fumeOn != true)
  48.                {
  49.                   this.fumeLeft.gotoAndPlay("on");
  50.                   _parent.monkeyShip.leftArm.gotoAndPlay("right");
  51.                }
  52.             }
  53.             else
  54.             {
  55.                this.fumeLeft.gotoAndPlay("off");
  56.             }
  57.             if(Key.isDown(Key.LEFT))
  58.             {
  59.                xMovement -= thrusterPower / 15;
  60.                _root.cocoFuel.Play();
  61.                if(this.fumeRight.fumeOn != true)
  62.                {
  63.                   this.fumeRight.gotoAndPlay("on");
  64.                   _parent.monkeyShip.leftArm.gotoAndPlay("left");
  65.                }
  66.             }
  67.             else
  68.             {
  69.                this.fumeRight.gotoAndPlay("off");
  70.             }
  71.             if(Key.isDown(Key.LEFT) == false and Key.isDown(Key.RIGHT) == false)
  72.             {
  73.                _root.cocoFuel.Stop();
  74.                _parent.monkeyShip.leftArm.gotoAndPlay("idle");
  75.             }
  76.             if(Key.isDown(Key.LEFT) == false and Key.isDown(Key.RIGHT) == false and Key.isDown(Key.UP) == false)
  77.             {
  78.                _root.sndThrusters.stop();
  79.                sndThrustersStarted = false;
  80.                _root.cocoFuel.Stop();
  81.                this.fumeDown.gotoAndPlay("off");
  82.                this.fumeLeft.gotoAndPlay("off");
  83.                this.fumeRight.gotoAndPlay("off");
  84.             }
  85.             else
  86.             {
  87.                if(sndThrustersStarted != true)
  88.                {
  89.                   sndThrustersStarted = true;
  90.                   _root.sndThrusters.start(0,999);
  91.                }
  92.                _root.cocoFuel.Play();
  93.                _root.sndThrustersPlaying = true;
  94.             }
  95.          }
  96.          else
  97.          {
  98.             _root.sndThrusters.stop();
  99.             this.fumeDown.gotoAndStop("off");
  100.             this.fumeLeft.gotoAndStop("off");
  101.             this.fumeRight.gotoAndStop("off");
  102.             _root.cocoFuel.Stop();
  103.          }
  104.          gravity += gravityFactor;
  105.          this._y += gravity;
  106.          this._x += xMovement;
  107.          this._rotation = xMovement;
  108.       }
  109.    }
  110. }
  111.